package com.superm.service.impl;

import com.superm.entity.Member;
import com.superm.entity.MemberLeve;
import com.superm.mappers.MemberMapper;
import com.superm.service.MemberService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MemberServiceImpl implements MemberService {

    @Autowired
    private MemberMapper memberMp;

    @Override
    public List<Member> selectLikeMemberList(Member member, Integer pageNo, Integer pageSize) {
        return memberMp.allMember(member,(pageNo-1)*pageSize,pageSize);
    }

    @Override
    public Member selectIdMember(Integer memberId) {
        return memberMp.selectMemberId(memberId);
    }

    @Override
    public int selectMemberCount(Member member) {
        return memberMp.selectCount(member);
    }

    @Override
    public int updateMember(Member member) {
        return memberMp.updateInfoMember(member);
    }

    @Override
    public int addMember(Member member) {
        return memberMp.addInfoMember(member);
    }

    @Override
    public int deleteMember(Integer memberId) {
        return memberMp.deleteInfoMember(memberId);
    }

    @Override
    public int updateOneMember(Integer memberId, String memstate) {
        return memberMp.updateOneInfoMation(memberId,memstate);
    }
    @Override
    public Member selMember(Member member) {
        return memberMp.selMember(member);
    }
}
